<?php include "../config.php";?>
<?php include "../coresection/connection.php";?>
<?php include "../coresection/checkUserSession.php";?>
<?php include "../coresection/order-list.php";?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <?php include 'modules/head.php'; ?>

    <style>
        #orderForm .layui-form-item .layui-form-label{
            font-size: 30px;
        }
        .layui-input-block{
            font-size:30px;
        }
        .layui-input-block input {
            margin-left: 10px;
        }
    </style>
</head>

<body>
<ul class="layui-nav">


    <li class="layui-nav-item btn_menu" style="float: left" > <i class="layui-icon">&#xe60f;</i>选择日期 </li>


    <li class="layui-nav-item" ><a href="<?echo $domain?>/m/order.php"><i class="layui-icon">&#xe60f;</i>订餐列表</a></li>
    <li class="layui-nav-item" ><a href="<?echo $domain?>/m/feedback.php"><i class="layui-icon">&#xe60f;</i>调查反馈</a></li>
    <li class="layui-nav-item" ><a href="<?echo $domain?>/m/setup.php"><i class="layui-icon">&#xe60f;</i>个人中心</a></li>

</ul>

<div class="header order_list">
<p style="font-size: 15px; color: red; text-align: left; padding: 0 5px;">*请先在左上方选择日期再订餐</p>
    <h1>欢迎使用订餐系统</h1>

    <div class="user_message">
        当前用户：<?php echo $user_name ?>  <?php echo $user_id ?> [<?php echo $department ?>]　
<!--        <span style=" margin-left: 15px;">日期：--><?php //echo $todayDate?><!-- --><?php //echo $weekDate?><!--</span>-->
    </div>



    <?php if($balance < 5){ ?>
        <span class="message">
            温馨提示：您账号所剩余额已经少于五元，已经不能点餐，请快充值。
        </span>
    <? } ?>

</div>




<!--menu start-->
<div class="menu"><?php include 'modules/menu.php'; ?></div>
<!--menu end-->



<div class="main order_main" ">






    <form id="orderForm" action="" method="post" autocomplete="off" enctype="multipart/form-data"   class=" ">
        <div class="right_area status-date" style="margin-left:0;">
            <p>
                <b>当前账户金额：</b><?php echo $balance ?>元<input type="hidden" value="<?php echo $balance ?>" class="balance"/><br>
                <b>当前交易金额：</b><b class="orderPrice">0</b>元<input type="hidden" value="0" class="order_price"/><br>
<!--                <b>当前可用余额：</b> --><?php //echo $balance ?><!-- 元-->
            </p>

        </div>
        <div class="center_area">
		
		</div>


        <div class="layui-form-item" >
            <div class="tips">
                请根据实际情况勾选，网点就餐的请选择配送，饭堂就餐的请选择堂食。
            </div>
            <label class="layui-form-label">就餐地点</label>
            <div class="layui-input-block">
                <input type="radio" id="nodiliver" name="diliver"  value="堂食" title="堂食" style="width: 25px;height:25px;"><label for="nodiliver">堂食</label>
                <input type="radio" id="diliver" name="diliver"  value="配送" title="配送" style="width: 25px;height:25px;"><label for="diliver">配送</label>
            </div>
        </div>



        <div style="width: 640px; float: left; text-align: left; margin-left: 15px;">


            <span class="layui-btn layui-btn-big orderSub button" style="float:left;">下订</span>

        </div>


    </form>
</div>




<div class="confirm" style=" margin:25px auto">

    <h1>订餐记录</h1>
    <h2><a href="setup_summary.php"  class="button layui-btn layui-btn-big">退订</a></h2>
    <div class="line_solid"></div>

        <div class="table_area">




            <div class="layui-form">
                <table class="layui-table">
                    <colgroup>
                        <col  >
                        <col  >
                        <col  >
                        <col  >
                        <col>
                        <col>
                    </colgroup>
                    <thead>
                    <tr>
                        <th>日期</th>
                        <th>类型</th>
                        <th>菜名</th>
                        <th>数量</th>
                        <th>总价</th>
                    </tr>
                    </thead>
                    <tbody>
                    <!--原本设置数值未 $sumOrder 显示所有订单，后来我改成最近订单100条信息-->
                    <?

                    if($sumOrder>10)
                    {
                        $sumOrder=10;
                    }

                    for($i=0;$i<$sumOrder;$i++){?>
                        <tr>
                            <td style="width:110px;">
<!--                                <strong>--><?// echo  $i+1 ?><!--</strong> /-->
                                <?echo substr($order_date[$i],7,12)?>

                                <br/>



                                <?
                                $temp  = str_replace("年","-",$order_date[$i]);
                                $temp1 = str_replace("月","-",$temp);
                                $temp2 = str_replace("日","",$temp1);

                                $theday=$temp2." 00:00:30";



                                switch(date( "w ",strtotime($theday))){
                                    case 0:
                                        echo "星期日";
                                        break;
                                    case 1:
                                        echo "星期一";
                                        break;
                                    case 2:
                                        echo "星期二";
                                        break;
                                    case 3:
                                        echo "星期三";
                                        break;
                                    case 4:
                                        echo "星期四";
                                        break;
                                    case 5:
                                        echo "星期五";
                                        break;
                                    case 6:
                                        echo "星期六";
                                        break;
                                }
                                ?>
                            </td>
                            <td>
                                <?
                                switch($order_at[$i]){
                                    case 1:
                                        echo "早餐";
                                        break;
                                    case 2:
                                        echo "午餐";
                                        break;
                                    case 3:
                                        echo "晚餐";
                                        break;
                                }
                                ?>
                            </td>
                            <td><?echo $product_name[$i]?></td>
                            <td> <?echo $product_numsum[$i]?> </td>
                            <td><?echo $order_price[$i]?></td>
                        </tr>
                    <?}?>

                    </tbody>
                </table>
            </div>






        </div>
</div>

<br />
<br />
<br />
<br />

</body>
</html>
